/*
 * ModulationMatrixPatchCablePanel.java
 *
 * Created on 10 juni 2008, 22:58
 */

package com.laamella.syntherface.synths.alesis.micron.gui;

import com.laamella.syntherface.synths.alesis.micron.model.ModulationMatrix;

@SuppressWarnings("serial") public class ModulationMatrixPatchCablePanel extends javax.swing.JPanel {

    /** Creates new form ModulationMatrixPatchCablePanel */
    public ModulationMatrixPatchCablePanel() {
        initComponents();
    }
	
	public void setModel(ModulationMatrix matrix, int cableNumber){
		sourceLabel.setModel(matrix.source[cableNumber]);
		sourceSlider.setModel(matrix.source[cableNumber]);
		destinationLabel.setModel(matrix.destination[cableNumber]);
		destinationSlider.setModel(matrix.destination[cableNumber]);
		levelSlider.setModel(matrix.level[cableNumber]);
		offsetSlider.setModel(matrix.offset[cableNumber]);
	}

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        sourceLabel = new com.laamella.syntherface.synths.gui.ParameterValueLabel();
        destinationLabel = new com.laamella.syntherface.synths.gui.ParameterValueLabel();
        linePanel1 = new com.laamella.syntherface.synths.gui.LinePanel();
        destinationSlider = new javax.swing.JSlider();
        sourceSlider = new javax.swing.JSlider();
        offsetSlider = new javax.swing.JSlider();
        levelSlider = new javax.swing.JSlider();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        setOpaque(false);
        setLayout(null);
        add(sourceLabel);
        sourceLabel.setBounds(0, 0, 103, 14);
        add(destinationLabel);
        destinationLabel.setBounds(190, 0, 103, 14);

        linePanel1.setArrowA(false);
        linePanel1.setHorizontal(true);

        javax.swing.GroupLayout linePanel1Layout = new javax.swing.GroupLayout(linePanel1);
        linePanel1.setLayout(linePanel1Layout);
        linePanel1Layout.setHorizontalGroup(
            linePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 20, Short.MAX_VALUE)
        );
        linePanel1Layout.setVerticalGroup(
            linePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 20, Short.MAX_VALUE)
        );

        add(linePanel1);
        linePanel1.setBounds(170, 0, 20, 20);

        destinationSlider.setOpaque(false);
        add(destinationSlider);
        destinationSlider.setBounds(180, 10, 210, 24);

        sourceSlider.setOpaque(false);
        add(sourceSlider);
        sourceSlider.setBounds(0, 10, 180, 24);

        offsetSlider.setOpaque(false);
        add(offsetSlider);
        offsetSlider.setBounds(490, 10, 100, 24);

        levelSlider.setOpaque(false);
        add(levelSlider);
        levelSlider.setBounds(390, 10, 100, 24);

        jLabel1.setText("offset");
        add(jLabel1);
        jLabel1.setBounds(490, 0, 29, 14);

        jLabel2.setText("level");
        add(jLabel2);
        jLabel2.setBounds(390, 0, 22, 14);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private com.laamella.syntherface.synths.gui.ParameterValueLabel destinationLabel;
    private javax.swing.JSlider destinationSlider;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JSlider levelSlider;
    private com.laamella.syntherface.synths.gui.LinePanel linePanel1;
    private javax.swing.JSlider offsetSlider;
    private com.laamella.syntherface.synths.gui.ParameterValueLabel sourceLabel;
    private javax.swing.JSlider sourceSlider;
    // End of variables declaration//GEN-END:variables

}
